#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@Time        : 2021/11/25 12:39
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : hog.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from skimage.feature import hog
from skimage.io import imread
from DIP_experiment_5.util import contrast_show

IM_PATH = "../experiment_fig/cameraman.jpg"  # 225*225
im = imread(IM_PATH, as_gray=True)
feature_vector, hog_image = hog(im, visualize=True)
print("HOG特征向量的维度:{}".format(*feature_vector.shape))
im_dict = {"origin image": im, "hog image": hog_image}
contrast_show(im_dict, (1, 2))
